<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TCP/IP 四层模型 - 网络协议架构详解</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .layer-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }
        
        .layer-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }
        
        .protocol-tag {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.875rem;
            display: inline-block;
            margin: 0.25rem;
            transition: all 0.2s ease;
        }
        
        .protocol-tag:hover {
            transform: scale(1.05);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }
        
        .section-title {
            position: relative;
            display: inline-block;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 100%;
            height: 3px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .mermaid {
            background: white;
            padding: 2rem;
            border-radius: 1rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }
        
        .layer-icon {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.5rem;
            margin-bottom: 1rem;
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
        }
        
        .content-wrapper {
            max-width: 1200px;
            margin: 0 auto;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20 px-6">
        <div class="content-wrapper text-center">
            <h1 class="text-5xl md:text-6xl font-bold mb-6 animate-fadeInUp">
                TCP/IP 四层模型
            </h1>
            <p class="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto animate-fadeInUp" style="animation-delay: 0.2s;">
                深入理解网络协议架构，掌握数据传输的核心原理
            </p>
            <div class="mt-8 animate-fadeInUp" style="animation-delay: 0.4s;">
                <i class="fas fa-network-wired text-4xl opacity-80"></i>
            </div>
        </div>
    </div>

    <!-- Introduction Section -->
    <div class="py-16 px-6">
        <div class="content-wrapper">
            <div class="bg-white rounded-2xl shadow-xl p-8 md:p-12">
                <p class="text-lg leading-relaxed text-gray-700 indent-8">
                    TCP/IP 四层模型是一种网络协议分层模型，用于描述计算机网络中的数据传输和通信过程。它是 TCP/IP 协议族的核心组成部分，将网络通信功能分解为不同的层次，每一层都承担特定的功能，以便实现网络数据的可靠传输。
                </p>
            </div>
        </div>
    </div>

    <!-- Network Architecture Visualization -->
    <div class="py-8 px-6">
        <div class="content-wrapper">
            <h2 class="text-3xl font-bold text-center mb-12">
                <span class="section-title">网络架构可视化</span>
            </h2>
            <div class="mermaid">
                graph TB
                    subgraph "应用层"
                        A1[HTTP/HTTPS]
                        A2[FTP]
                        A3[SMTP]
                        A4[DNS]
                    end
                    
                    subgraph "传输层"
                        T1[TCP]
                        T2[UDP]
                    end
                    
                    subgraph "网络层"
                        N1[IP]
                        N2[ICMP]
                        N3[ARP]
                    end
                    
                    subgraph "网络接口层"
                        L1[以太网]
                        L2[Wi-Fi]
                        L3[PPP]
                    end
                    
                    A1 --> T1
                    A2 --> T1
                    A3 --> T1
                    A4 --> T2
                    T1 --> N1
                    T2 --> N1
                    N1 --> L1
                    N1 --> L2
                    N1 --> L3
                    
                    style A1 fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style A2 fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style A3 fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style A4 fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style T1 fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                    style T2 fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                    style N1 fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style N2 fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style N3 fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style L1 fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                    style L2 fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                    style L3 fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </div>
    </div>

    <!-- Layers Section -->
    <div class="py-16 px-6">
        <div class="content-wrapper">
            <h2 class="text-3xl font-bold text-center mb-12">
                <span class="section-title">四层架构详解</span>
            </h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- Layer 1: Network Interface Layer -->
                <div class="layer-card rounded-2xl p-8">
                    <div class="layer-icon">
                        <i class="fas fa-ethernet"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">
                        1. 网络接口层
                        <span class="text-sm font-normal text-gray-500 ml-2">Network Interface Layer</span>
                    </h3>
                    
                    <h4 class="text-lg font-semibold text-purple-600 mb-3">
                        <i class="fas fa-cogs mr-2"></i>功能
                    </h4>
                    <ul class="space-y-2 mb-6 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-3"></i>
                            <span>也称为链路层（Link Layer）或数据链路层（Data Link Layer）</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-3"></i>
                            <span>负责在局域网或广域网的物理网络中传输数据帧，处理设备到设备之间的物理连接和数据帧的传输</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-3"></i>
                            <span>处理数据的物理地址（MAC 地址）和链路层协议（如以太网、Wi-Fi）</span>
                        </li>
                    </ul>
                    
                    <h4 class="text-lg font-semibold text-purple-600 mb-3">
                        <i class="fas fa-puzzle-piece mr-2"></i>主要协议
                    </h4>
                    <div class="flex flex-wrap">
                        <span class="protocol-tag">以太网（Ethernet）</span>
                        <span class="protocol-tag">Wi-Fi</span>
                        <span class="protocol-tag">PPP</span>
                    </div>
                </div>

                <!-- Layer 2: Internet Layer -->
                <div class="layer-card rounded-2xl p-8">
                    <div class="layer-icon">
                        <i class="fas fa-globe"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">
                        2. 网络层
                        <span class="text-sm font-normal text-gray-500 ml-2">Internet Layer</span>
                    </h3>
                    
                    <h4 class="text-lg font-semibold text-purple-600 mb-3">
                        <i class="fas fa-cogs mr-2"></i>功能
                    </h4>
                    <ul class="space-y-2 mb-6 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-3"></i>
                            <span>负责将数据包从源主机传送到目标主机，并处理数据包的路由选择</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-3"></i>
                            <span>主要处理数据的逻辑地址（IP 地址），并管理不同网络之间的数据传输</span>
                        </li>
                    </ul>
                    
                    <h4 class="text-lg font-semibold text-purple-600 mb-3">
                        <i class="fas fa-puzzle-piece mr-2"></i>主要协议
                    </h4>
                    <div class="space-y-2">
                        <div class="flex items-start">
                            <span class="protocol-tag">IP</span>
                            <span class="text-sm text-gray-600 ml-3 mt-1">提供数据包的逻辑寻址和路由功能（IPv4/IPv6）</span>
                        </div>
                        <div class="flex items-start">
                            <span class="protocol-tag">ICMP</span>
                            <span class="text-sm text-gray-600 ml-3 mt-1">用于网络诊断和错误报告（如 ping 命令）</span>
                        </div>
                        <div class="flex items-start">
                            <span class="protocol-tag">ARP</span>
                            <span class="text-sm text-gray-600 ml-3 mt-1">将 IP 地址解析为 MAC 地址</span>
                        </div>
                    </div>
                </div>

                <!-- Layer 3: Transport Layer -->
                <div class="layer-card rounded-2xl p-8">
                    <div class="layer-icon">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">
                        3. 传输层
                        <span class="text-sm font-normal text-gray-500 ml-2">Transport Layer</span>
                    </h3>
                    
                    <h4 class="text-lg font-semibold text-purple-600 mb-3">
                        <i class="fas fa-cogs mr-2"></i>功能
                    </h4>
                    <ul class="space-y-2 mb-6 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-3"></i>
                            <span>负责数据的端到端传输，确保数据在源主机和目标主机之间可靠地传输</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-3"></i>
                            <span>提供数据流控制、错误检测和纠正，